import 'package:flutter_tiktok/controller/tikTokVideoListController.dart';
import 'package:get/get.dart';
import 'package:jet_rails/jr_app/jr_models/jr_video_model.dart';
import 'package:jet_rails/jr_services/jr_services.dart';

class JrVideoController extends GetxController {
  TikTokVideoListController? ttVideoListController;
  refreshVideoList() {
    JrServices.instance.allVideo.refresh();
  }

  void toggleLikeStatus(JrVideoModel item) {
    item.like = !item.like;
    refreshVideoList();
    JrServices.instance.saveVideo();
  }

  @override
  void onClose() {
    ttVideoListController?.dispose();
    ttVideoListController = null;
    super.onClose();
  }
}
